home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / Xm / XmQTnavigator.z / XmQTnavigator
Text File  |  1998-10-30  |  21KB  |  397 lines

  1.  
  2.  
  3.  
  4.      XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV         XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           _X_m_Q_T_n_a_v_i_g_a_t_o_r - A widget holding this trait can act as a
  10.           navigator
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.           #include <Xm/NavigatorT.h>
  14.  
  15.           typedef struct {
  16.                     int                     version;
  17.                     XmNavigatorMoveCBProc   changeMoveCB;
  18.                     XmNavigatorSetValueProc setValue;
  19.                     XmNavigatorGetValueProc getValue;
  20.           } XmNavigatorTraitRec, *XmNavigatorTrait;
  21.           vvvvooooiiiidddd ((((****XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrMMMMoooovvvveeeeCCCCBBBBPPPPrrrroooocccc))))(
  22.           WWWWiiiiddddggggeeeetttt,
  23.           XXXXttttCCCCaaaallllllllbbbbaaaacccckkkkPPPPrrrroooocccc,
  24.           XXXXttttPPPPooooiiiinnnntttteeeerrrr,
  25.           BBBBoooooooolllleeeeaaaannnn,
  26.           vvvvooooiiiidddd ((((****XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrSSSSeeeettttVVVVaaaalllluuuueeeePPPPrrrroooocccc))))(
  27.           WWWWiiiiddddggggeeeetttt,
  28.           XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrDDDDaaaattttaaaa,
  29.           BBBBoooooooolllleeeeaaaannnn,
  30.           vvvvooooiiiidddd ((((****XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrGGGGeeeettttVVVVaaaalllluuuueeeePPPPrrrroooocccc))))(
  31.           WWWWiiiiddddggggeeeetttt,
  32.           XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrDDDDaaaattttaaaa);
  33.  
  34.      VVVVEEEERRRRSSSSIIIIOOOONNNN
  35.           This page documents Motif 2.1.
  36.  
  37.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  38.           A child widget holding the _X_m_Q_T_n_a_v_i_g_a_t_o_r trait can act as a
  39.           navigator widget.  A user can manipulate a navigator widget
  40.           in order to make different parts of a scrollable widget
  41.           visible.
  42.  
  43.           In the standard Motif widget set, the XXXXmmmmSSSSccccrrrroooollllllllBBBBaaaarrrr and
  44.           XXXXmmmmSSSSppppiiiinnnnBBBBooooxxxxwidgets hold the _X_m_Q_T_n_a_v_i_g_a_t_o_r trait. In the Exm
  45.           demonstration widget set, the EEEExxxxmmmmPPPPaaaannnnnnnneeeerrrr widget holds this
  46.           trait.
  47.  
  48.           Widgets holding the _X_m_Q_T_n_a_v_i_g_a_t_o_r trait can cooperate with
  49.           widgets holding the _X_m_Q_T_s_c_r_o_l_l_F_r_a_m_e trait.
  50.  
  51.           Two of the trait methods, sssseeeettttVVVVaaaalllluuuueeee and ggggeeeettttVVVVaaaalllluuuueeee, require an
  52.           XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrDDDDaaaattttaaaa structure, which has the following
  53.           definition:
  54.  
  55.           typedef struct {
  56.                     Mask      valueMask;
  57.                     Mask      dimMask;
  58.                     XmTwoDIntRec    *value;
  59.                     XmTwoDIntRec    *minimum;
  60.  
  61.  
  62.  
  63.      Page 1                                         (printed 10/24/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV         XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))
  71.  
  72.  
  73.  
  74.                     XmTwoDIntRec    *maximum;
  75.                     XmTwoDIntRec    *slider_size;
  76.                     XmTwoDIntRec    *increment;
  77.                     XmTwoDIntRec    *page_increment;
  78.           } XmNavigatorDataRec, *XmNavigatorData;
  79.  
  80.           where _X_m_T_w_o_D_I_n_t_R_e_c is a 2-field structure defined as
  81.           follows:
  82.  
  83.           typedef struct {
  84.                     int     x;
  85.                     int     y;
  86.           } XmTwoDIntRec, *XmTwoDInt;
  87.  
  88.           Following is a detailed description of the fields of the
  89.           XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrDDDDaaaattttaaaa structure:
  90.  
  91.           _v_a_l_u_e_M_a_s_k Holds a bit vector mask. Each bit in the bit
  92.                     vector mask represents a different field in the
  93.                     XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrDDDDaaaattttaaaa structure.  If a bit is set, then
  94.                     the data for that field is valid.  If that bit is
  95.                     not set, then the data within that field is
  96.                     ignored.  Motif provides the following constants,
  97.                     each representing one bit of the bit mask. The
  98.                     caller can add any combination of the following
  99.                     constants in order to form the appropriate
  100.                     _v_a_l_u_e_M_a_s_k value:
  101.  
  102.                     NNNNaaaavvvvDDDDiiiimmmmMMMMaaaasssskkkk
  103.                               Validates the _d_i_m_M_a_s_k field.
  104.  
  105.                     NNNNaaaavvvvVVVVaaaalllluuuueeee  Validates the _v_a_l_u_e field.
  106.  
  107.                     NNNNaaaavvvvMMMMiiiinnnniiiimmmmuuuummmm
  108.                               Validates the _m_i_n_i_m_u_m field.
  109.  
  110.                     NNNNaaaavvvvMMMMaaaaxxxxiiiimmmmuuuummmm
  111.                               Validates the _m_a_x_i_m_u_m field.
  112.  
  113.                     NNNNaaaavvvvSSSSlllliiiiddddeeeerrrrSSSSiiiizzzzeeee
  114.                               Validates the _s_l_i_d_e_r__s_i_z_e field.
  115.  
  116.                     NNNNaaaavvvvIIIInnnnccccrrrreeeemmmmeeeennnntttt
  117.                               Validates the _i_n_c_r_e_m_e_n_t field.
  118.  
  119.                     NNNNaaaavvvvPPPPaaaaggggeeeeIIIInnnnccccrrrreeeemmmmeeeennnntttt
  120.                               Validates the _p_a_g_e__i_n_c_r_e_m_e_n_t field.
  121.  
  122.                     NNNNaaaavvvvAAAAllllllllVVVVaaaalllliiiidddd
  123.                               Validates all fields.
  124.  
  125.           _d_i_m_M_a_s_k   Holds a bit vector mask. Each bit in the bit
  126.  
  127.  
  128.  
  129.      Page 2                                         (printed 10/24/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV         XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))
  137.  
  138.  
  139.  
  140.                     vector mask represents a different dimension.
  141.                     Currently, the only two supported dimensions are _x
  142.                     and _y.  Therefore, 1 bit of this mask represents
  143.                     the _x dimension and another bit represents the _y
  144.                     dimension.  Motif provides the following
  145.                     constants, each representing 1 bit of the bit
  146.                     mask. The caller may add any combination of the
  147.                     following constants in order to form the
  148.                     appropriate _d_i_m_M_a_s_k value:
  149.  
  150.                     NNNNaaaavvvviiiiggggDDDDiiiimmmmeeeennnnssssiiiioooonnnnXXXX
  151.                               Validates the _x dimension.
  152.  
  153.                     NNNNaaaavvvviiiiggggDDDDiiiimmmmeeeennnnssssiiiioooonnnnYYYY
  154.                               Validates the _y dimension.
  155.  
  156.                     The value of the _d_i_m_M_a_s_k field affects the
  157.                     interpretation of the _v_a_l_u_e, _m_i_n_i_m_u_m, _m_a_x_i_m_u_m,
  158.                     _s_l_i_d_e_r__s_i_z_e, _i_n_c_r_e_m_e_n_t, and _p_a_g_e__i_n_c_r_e_m_e_n_t fields.
  159.                     The value of _d_i_m_M_a_s_kaffects these other fields
  160.                     even if NNNNaaaavvvvDDDDiiiimmmmMMMMaaaasssskkkk is not set.  In fact, the only
  161.                     time that NNNNaaaavvvvDDDDiiiimmmmMMMMaaaasssskkkk has influence is when the
  162.                     caller is trying to change or read the value of
  163.                     _d_i_m_M_a_s_k.
  164.  
  165.           _v_a_l_u_e     Holds a TTTTwwwwooooDDDDIIIInnnnttttRRRReeeecccc structure containing two
  166.                     values:  one is the value of the navigator widget
  167.                     in the _x dimension, and the other is the value in
  168.                     the _y dimension.  For example, suppose the _v_a_l_u_e
  169.                     in the _x dimension is 50, the _m_i_n_i_m_u_m is 10, and
  170.                     the _m_a_x_i_m_u_m is 90. In this case, the navigator
  171.                     widget will have a horizontal position halfway
  172.                     between the left and right sides of the widget.
  173.  
  174.           _m_i_n_i_m_u_m   Holds a TTTTwwwwooooDDDDIIIInnnnttttRRRReeeecccc structure containing two
  175.                     values:  one is the minimum value of the navigator
  176.                     widget in the _x dimension and the other is the
  177.                     minimum value in the _y dimension.
  178.  
  179.           _m_a_x_i_m_u_m   Holds a TTTTwwwwooooDDDDIIIInnnnttttRRRReeeecccc structure containing two
  180.                     values:  one is the maximum value of the navigator
  181.                     widget in the _x dimension and the other is the
  182.                     maximum value in the _y dimension.
  183.  
  184.           _s_l_i_d_e_r__s_i_z_e
  185.                     Holds a TTTTwwwwooooDDDDIIIInnnnttttRRRReeeecccc structure containing two
  186.                     values:  one is the slider size of the navigator
  187.                     widget in the _x dimension and the other is the
  188.                     slider size in the _y dimension.  The _s_l_i_d_e_r__s_i_z_e
  189.                     value is not an absolute value; for example, it is
  190.                     not a size in pixels. The actual size of the
  191.                     slider is based on the ratio of the _s_l_i_d_e_r__s_i_z_e to
  192.  
  193.  
  194.  
  195.      Page 3                                         (printed 10/24/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV         XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))
  203.  
  204.  
  205.  
  206.                     the difference between the _m_i_n_i_m_u_m and _m_a_x_i_m_u_m.
  207.                     For example, suppose the _s_l_i_d_e_r__s_i_z_e in the _x
  208.                     dimension is 20, the _m_i_n_i_m_u_m is 10, and the
  209.                     _m_a_x_i_m_u_m is 90. In this case, the difference
  210.                     between the _m_i_n_i_m_u_m and the _m_a_x_i_m_u_m is 80.
  211.                     Therefore, the slider will occupy 20/80 (or 25%)
  212.                     of the allocated widget space in the _x dimension.
  213.  
  214.           _i_n_c_r_e_m_e_n_t Holds a TTTTwwwwooooDDDDIIIInnnnttttRRRReeeecccc structure containing two
  215.                     values:  one is the increment size of the
  216.                     navigator widget in the _x dimension and the other
  217.                     is the increment size in the _y dimension.  The
  218.                     increment size is the amount by which the
  219.                     _v_a_l_u_eincreases or decreases when the user takes an
  220.                     action that moves the slider by one increment.
  221.  
  222.           _p_a_g_e__i_n_c_r_e_m_e_n_t
  223.                     Holds a TTTTwwwwooooDDDDIIIInnnnttttRRRReeeecccc structure containing two
  224.                     values:  one is the page increment size of the
  225.                     navigator widget in the _x dimension and the other
  226.                     is the page increment size in the _y dimension.
  227.                     The page increment size is the amount by which the
  228.                     _v_a_l_u_e increases or decreases when the user takes
  229.                     an action that moves the slider by one page
  230.                     increment.
  231.  
  232.         TTTThhhheeee cccchhhhaaaannnnggggeeeeMMMMoooovvvveeeeCCCCBBBB TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd
  233.           vvvvooooiiiidddd cccchhhhaaaannnnggggeeeeMMMMoooovvvveeeeCCCCBBBB(
  234.           WWWWiiiiddddggggeeeetttt nnnnaaaavvvviiiiggggaaaattttoooorrrrWWWWiiiiddddggggeeeetttt,
  235.           XXXXttttCCCCaaaallllllllbbbbaaaacccckkkkPPPPrrrroooocccc mmmmoooovvvveeeeCCCCBBBB,
  236.           XXXXttttPPPPooooiiiinnnntttteeeerrrr cccclllloooossssuuuurrrreeee,
  237.           BBBBoooooooolllleeeeaaaannnn sssseeeettttUUUUnnnnsssseeeetttt);
  238.  
  239.           The cccchhhhaaaannnnggggeeeeMMMMoooovvvveeeeCCCCBBBB trait method is responsible for adding or
  240.           removing the _m_o_v_e_C_B callback from the list of callbacks.  A
  241.           child widget holding the _X_m_Q_T_n_a_v_i_g_a_t_o_r trait should provide
  242.           a resource that holds the name of the move callback
  243.           procedure.  This callback will be activated whenever a user
  244.           moves an indicator in the _n_a_v_i_g_a_t_o_r_W_i_d_g_e_t.
  245.  
  246.           Following is a sample implementation of this trait method.
  247.           In this implementation, the _E_x_m_N_m_o_v_e_C_a_l_l_b_a_c_k resource holds
  248.           the name of the move callback procedure.
  249.  
  250.           NavigChangeMoveCB(
  251.                      Widget navigatorWidget,
  252.                      XtCallbackProc moveCB,
  253.                      XtPointer closure,
  254.                      Boolean setunset)
  255.           {
  256.             if (setunset)
  257.               XtAddCallback (navigatorWidget, ExmNmoveCallback, moveCB, closure);
  258.  
  259.  
  260.  
  261.      Page 4                                         (printed 10/24/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV         XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))
  269.  
  270.  
  271.  
  272.             else
  273.               XtRemoveCallback (navigatorWidget, ExmNmoveCallback, moveCB, closure);
  274.           }
  275.  
  276.           _n_a_v_i_g_a_t_o_r_W_i_d_g_e_t
  277.                     Specifies the child widget that is to have its
  278.                     list of callbacks modified.
  279.  
  280.           _m_o_v_e_C_B    Specifies the callback procedure that is to be
  281.                     added or removed from the list of callbacks.
  282.  
  283.           _c_l_o_s_u_r_e   Specifies additional data to be passed to the
  284.                     callback.
  285.  
  286.           _s_e_t_U_n_s_e_t  Specifies a BBBBoooooooolllleeeeaaaannnn value. If this value is _T_r_u_e,
  287.                     the sssseeeettttVVVVaaaalllluuuueeeetrait method adds _m_o_v_e_C_B to the list
  288.                     of callbacks. If this value is _F_a_l_s_e, the _m_o_v_e_C_B
  289.                     is removed from the list of callbacks.
  290.  
  291.         TTTThhhheeee sssseeeettttVVVVaaaalllluuuueeee TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd
  292.           vvvvooooiiiidddd sssseeeettttVVVVaaaalllluuuueeee(
  293.           WWWWiiiiddddggggeeeetttt nnnnaaaavvvviiiiggggaaaattttoooorrrrWWWWiiiiddddggggeeeetttt,
  294.           XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrDDDDaaaattttaaaa nnnnaaaavvvviiiiggggaaaattttoooorrrrDDDDaaaattttaaaa,
  295.           BBBBoooooooolllleeeeaaaannnn nnnnoooottttiiiiffffyyyy);
  296.  
  297.           The sssseeeettttVVVVaaaalllluuuueeee trait method allows the caller to pass new
  298.           navigator data to the _n_a_v_i_g_a_t_o_r_W_i_d_g_e_t.
  299.  
  300.           _n_a_v_i_g_a_t_o_r_W_i_d_g_e_t
  301.                     Specifies the navigator widget that provides this
  302.                     method.
  303.  
  304.           _n_a_v_i_g_a_t_o_r_D_a_t_a
  305.                     Specifies an XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrDDDDaaaattttaaaa structure whose
  306.                     fields describe the characteristics of the
  307.                     navigator widget.
  308.  
  309.           _n_o_t_i_f_y    Specifies a BBBBoooooooolllleeeeaaaannnn value. If _T_r_u_e, the caller
  310.                     wants sssseeeettttVVVVaaaalllluuuueeee to activate the move callback
  311.                     procedure whenever there is a change in the _v_a_l_u_e
  312.                     field of the _n_a_v_i_g_a_t_o_r_D_a_t_a structure.
  313.  
  314.         TTTThhhheeee ggggeeeettttVVVVaaaalllluuuueeee TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd
  315.           vvvvooooiiiidddd ggggeeeettttVVVVaaaalllluuuueeee(
  316.           WWWWiiiiddddggggeeeetttt nnnnaaaavvvviiiiggggaaaattttoooorrrrWWWWiiiiddddggggeeeetttt,
  317.           XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrDDDDaaaattttaaaa nnnnaaaavvvviiiiggggaaaattttoooorrrrDDDDaaaattttaaaa);
  318.  
  319.           The ggggeeeettttVVVVaaaalllluuuueeee trait method returns the current
  320.           _n_a_v_i_g_a_t_o_r_D_a_t_aheld by the _n_a_v_i_g_a_t_o_r_W_i_d_g_e_t. Not all of the
  321.           fields in the returned _n_a_v_i_g_a_t_o_r_D_a_t_a will hold valid data.
  322.           The caller of ggggeeeettttVVVVaaaalllluuuueeeemust analyze the returned _v_a_l_u_e_M_a_s_k
  323.           and _d_i_m_M_a_s_k fields to determine which of the other fields
  324.  
  325.  
  326.  
  327.      Page 5                                         (printed 10/24/98)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV         XXXXmmmmQQQQTTTTnnnnaaaavvvviiiiggggaaaattttoooorrrr((((3333XXXX))))
  335.  
  336.  
  337.  
  338.           hold valid data.
  339.  
  340.           _n_a_v_i_g_a_t_o_r_W_i_d_g_e_t
  341.                     Specifies the navigator widget that provides this
  342.                     method.
  343.  
  344.           _n_a_v_i_g_a_t_o_r_D_a_t_a
  345.                     Specifies an XXXXmmmmNNNNaaaavvvviiiiggggaaaattttoooorrrrDDDDaaaattttaaaa structure whose
  346.                     fields describe the characteristics of the
  347.                     navigator widget.
  348.  
  349.      RRRREEEELLLLAAAATTTTEEEEDDDD
  350.           XXXXmmmmQQQQTTTTssssccccrrrroooollllllllFFFFrrrraaaammmmeeee(3), XXXXmmmmSSSSccccrrrroooollllllllBBBBaaaarrrr(3), XXXXmmmmSSSSppppiiiinnnnBBBBooooxxxx(3), and
  351.           EEEExxxxmmmmPPPPaaaannnnnnnneeeerrrr(3).
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.      Page 6                                         (printed 10/24/98)
  394.  
  395.  
  396.  
  397.